<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InfChatBuffer</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
<link rel="home" href="index.html" title="libinfinity-0.4 Reference Manual">
<link rel="up" href="ch02.html" title="Common libinfinity API">
<link rel="prev" href="InfChatSession.html" title="InfChatSession">
<link rel="next" href="InfUserTable.html" title="InfUserTable">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="InfChatSession.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libinfinity-0.4 Reference Manual</th>
<td><a accesskey="n" href="InfUserTable.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#InfChatBuffer.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#InfChatBuffer.description" class="shortcut">Description</a>
                   | 
                  <a href="#InfChatBuffer.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#InfChatBuffer.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
                   | 
                  <a href="#InfChatBuffer.properties" class="shortcut">Properties</a>
                   | 
                  <a href="#InfChatBuffer.signals" class="shortcut">Signals</a>
</td></tr>
</table>
<div class="refentry" title="InfChatBuffer">
<a name="InfChatBuffer"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="InfChatBuffer.top_of_page"></a>InfChatBuffer</span></h2>
<p>InfChatBuffer — A ring buffer for chat messages</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1" title="Stability Level">
<a name="InfChatBuffer.stability-level"></a><h2>Stability Level</h2>
Unstable, unless otherwise indicated
</div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="InfChatBuffer.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;libinfinity/common/inf-chat-buffer.h&gt;

enum                <a class="link" href="InfChatBuffer.html#InfChatBufferMessageType" title="enum InfChatBufferMessageType">InfChatBufferMessageType</a>;
                    <a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage">InfChatBufferMessage</a>;
                    <a class="link" href="InfChatBuffer.html#InfChatBuffer-struct" title="InfChatBuffer">InfChatBuffer</a>;
                    <a class="link" href="InfChatBuffer.html#InfChatBufferClass" title="InfChatBufferClass">InfChatBufferClass</a>;
<a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="returnvalue">InfChatBufferMessage</span></a> * <a class="link" href="InfChatBuffer.html#inf-chat-buffer-message-copy" title="inf_chat_buffer_message_copy ()">inf_chat_buffer_message_copy</a>     (<em class="parameter"><code>const <a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="type">InfChatBufferMessage</span></a> *message</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfChatBuffer.html#inf-chat-buffer-message-free" title="inf_chat_buffer_message_free ()">inf_chat_buffer_message_free</a>        (<em class="parameter"><code><a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="type">InfChatBufferMessage</span></a> *message</code></em>);
<a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="returnvalue">InfChatBuffer</span></a> *     <a class="link" href="InfChatBuffer.html#inf-chat-buffer-new" title="inf_chat_buffer_new ()">inf_chat_buffer_new</a>                 (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> size</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfChatBuffer.html#inf-chat-buffer-add-message" title="inf_chat_buffer_add_message ()">inf_chat_buffer_add_message</a>         (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> *by</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *message</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
                                                         <em class="parameter"><code><span class="type">time_t</span> time</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfChatBuffer.html#inf-chat-buffer-add-emote-message" title="inf_chat_buffer_add_emote_message ()">inf_chat_buffer_add_emote_message</a>   (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> *by</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *message</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
                                                         <em class="parameter"><code><span class="type">time_t</span> time</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfChatBuffer.html#inf-chat-buffer-add-userjoin-message" title="inf_chat_buffer_add_userjoin_message ()">inf_chat_buffer_add_userjoin_message</a>
                                                        (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> *user</code></em>,
                                                         <em class="parameter"><code><span class="type">time_t</span> time</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfChatBuffer.html#inf-chat-buffer-add-userpart-message" title="inf_chat_buffer_add_userpart_message ()">inf_chat_buffer_add_userpart_message</a>
                                                        (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> *user</code></em>,
                                                         <em class="parameter"><code><span class="type">time_t</span> time</code></em>);
const <a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="returnvalue">InfChatBufferMessage</span></a> * <a class="link" href="InfChatBuffer.html#inf-chat-buffer-get-message" title="inf_chat_buffer_get_message ()">inf_chat_buffer_get_message</a>
                                                        (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> n</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="InfChatBuffer.html#inf-chat-buffer-get-n-messages" title="inf_chat_buffer_get_n_messages ()">inf_chat_buffer_get_n_messages</a>      (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="InfChatBuffer.html#inf-chat-buffer-get-size" title="inf_chat_buffer_get_size ()">inf_chat_buffer_get_size</a>            (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="InfChatBuffer.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----InfChatBuffer
</pre>
</div>
<div class="refsect1" title="Implemented Interfaces">
<a name="InfChatBuffer.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
InfChatBuffer implements
 <a class="link" href="InfBuffer.html" title="InfBuffer">InfBuffer</a>.</p>
</div>
<div class="refsect1" title="Properties">
<a name="InfChatBuffer.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="InfChatBuffer.html#InfChatBuffer--size" title='The "size" property'>size</a>"                     <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a>                 : Read / Write / Construct Only
</pre>
</div>
<div class="refsect1" title="Signals">
<a name="InfChatBuffer.signals"></a><h2>Signals</h2>
<pre class="synopsis">
  "<a class="link" href="InfChatBuffer.html#InfChatBuffer-add-message" title='The "add-message" signal'>add-message</a>"                                    : Run Last
</pre>
</div>
<div class="refsect1" title="Description">
<a name="InfChatBuffer.description"></a><h2>Description</h2>
<p>
<a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> contains the chat messages for a <a class="link" href="InfChatSession.html" title="InfChatSession"><span class="type">InfChatSession</span></a>.
</p>
</div>
<div class="refsect1" title="Details">
<a name="InfChatBuffer.details"></a><h2>Details</h2>
<div class="refsect2" title="enum InfChatBufferMessageType">
<a name="InfChatBufferMessageType"></a><h3>enum InfChatBufferMessageType</h3>
<pre class="programlisting">typedef enum _InfChatBufferMessageType {
  INF_CHAT_BUFFER_MESSAGE_NORMAL,
  INF_CHAT_BUFFER_MESSAGE_EMOTE,
  INF_CHAT_BUFFER_MESSAGE_USERJOIN,
  INF_CHAT_BUFFER_MESSAGE_USERPART
} InfChatBufferMessageType;
</pre>
<p>
Possible chat message types.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="INF-CHAT-BUFFER-MESSAGE-NORMAL:CAPS"></a><span class="term"><code class="literal">INF_CHAT_BUFFER_MESSAGE_NORMAL</code></span></p></td>
<td>A normal chat message.
</td>
</tr>
<tr>
<td><p><a name="INF-CHAT-BUFFER-MESSAGE-EMOTE:CAPS"></a><span class="term"><code class="literal">INF_CHAT_BUFFER_MESSAGE_EMOTE</code></span></p></td>
<td>An emote chat message (/me is doing
something).
</td>
</tr>
<tr>
<td><p><a name="INF-CHAT-BUFFER-MESSAGE-USERJOIN:CAPS"></a><span class="term"><code class="literal">INF_CHAT_BUFFER_MESSAGE_USERJOIN</code></span></p></td>
<td>A user join notification.
</td>
</tr>
<tr>
<td><p><a name="INF-CHAT-BUFFER-MESSAGE-USERPART:CAPS"></a><span class="term"><code class="literal">INF_CHAT_BUFFER_MESSAGE_USERPART</code></span></p></td>
<td>A user part notification.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="InfChatBufferMessage">
<a name="InfChatBufferMessage"></a><h3>InfChatBufferMessage</h3>
<pre class="programlisting">typedef struct {
  InfChatBufferMessageType type;
  InfUser* user;
  gchar* text;
  gsize length;
  time_t time;
} InfChatBufferMessage;
</pre>
<p>
Represents a chat message.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a class="link" href="InfChatBuffer.html#InfChatBufferMessageType" title="enum InfChatBufferMessageType"><span class="type">InfChatBufferMessageType</span></a> <em class="structfield"><code><a name="InfChatBufferMessage.type"></a>type</code></em>;</span></p></td>
<td>The <a class="link" href="InfChatBuffer.html#InfChatBufferMessageType" title="enum InfChatBufferMessageType"><span class="type">InfChatBufferMessageType</span></a> of the message.
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> *<em class="structfield"><code><a name="InfChatBufferMessage.user"></a>user</code></em>;</span></p></td>
<td>The <a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> that issued the message.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="InfChatBufferMessage.text"></a>text</code></em>;</span></p></td>
<td>The UTF-8 encoded text of the message.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> <em class="structfield"><code><a name="InfChatBufferMessage.length"></a>length</code></em>;</span></p></td>
<td>The length of the message, in bytes.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">time_t</span> <em class="structfield"><code><a name="InfChatBufferMessage.time"></a>time</code></em>;</span></p></td>
<td>The time at which the message was received.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="InfChatBuffer">
<a name="InfChatBuffer-struct"></a><h3>InfChatBuffer</h3>
<pre class="programlisting">typedef struct _InfChatBuffer InfChatBuffer;</pre>
<p>
<a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> is an opaque data type. You should only access it via the
public API functions.
</p>
</div>
<hr>
<div class="refsect2" title="InfChatBufferClass">
<a name="InfChatBufferClass"></a><h3>InfChatBufferClass</h3>
<pre class="programlisting">typedef struct {
  void (*add_message)(InfChatBuffer* buffer,
                      const InfChatBufferMessage* message);
} InfChatBufferClass;
</pre>
<p>
This structure contains default signal handlers for <a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfChatBufferClass.add-message"></a>add_message</code></em> ()</span></p></td>
<td>Default signal handler for the <a class="link" href="InfChatBuffer.html#InfChatBuffer-add-message" title='The "add-message" signal'><span class="type">"add-message"</span></a>
signal.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_chat_buffer_message_copy ()">
<a name="inf-chat-buffer-message-copy"></a><h3>inf_chat_buffer_message_copy ()</h3>
<pre class="programlisting"><a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="returnvalue">InfChatBufferMessage</span></a> * inf_chat_buffer_message_copy     (<em class="parameter"><code>const <a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="type">InfChatBufferMessage</span></a> *message</code></em>);</pre>
<p>
Creates a copy of the given message.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
<td>The <a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="type">InfChatBufferMessage</span></a> to copy.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new <a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="type">InfChatBufferMessage</span></a>. Free with
<a class="link" href="InfChatBuffer.html#inf-chat-buffer-message-free" title="inf_chat_buffer_message_free ()"><code class="function">inf_chat_buffer_message_free()</code></a> when no longer needed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_chat_buffer_message_free ()">
<a name="inf-chat-buffer-message-free"></a><h3>inf_chat_buffer_message_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_chat_buffer_message_free        (<em class="parameter"><code><a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="type">InfChatBufferMessage</span></a> *message</code></em>);</pre>
<p>
Frees the given <a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="type">InfChatBufferMessage</span></a> which must have been created with
<a class="link" href="InfChatBuffer.html#inf-chat-buffer-message-copy" title="inf_chat_buffer_message_copy ()"><code class="function">inf_chat_buffer_message_copy()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
<td>A <a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="type">InfChatBufferMessage</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_chat_buffer_new ()">
<a name="inf-chat-buffer-new"></a><h3>inf_chat_buffer_new ()</h3>
<pre class="programlisting"><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="returnvalue">InfChatBuffer</span></a> *     inf_chat_buffer_new                 (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> size</code></em>);</pre>
<p>
Creates a new <a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> which contains no initial messages. <em class="parameter"><code>size</code></em>
specifies how many messages to store before dropping old messages.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
<td>The number of messages to store.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new <a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_chat_buffer_add_message ()">
<a name="inf-chat-buffer-add-message"></a><h3>inf_chat_buffer_add_message ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_chat_buffer_add_message         (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> *by</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *message</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
                                                         <em class="parameter"><code><span class="type">time_t</span> time</code></em>);</pre>
<p>
Adds a new message to the chat buffer. If the buffer is full (meaning the
number of messages in the buffer equals its size), then an old message will
get discarded. If the message to be added is older than all other messages
in the buffer, then it will not be added at all.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>A <a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>by</code></em> :</span></p></td>
<td>A <a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> who wrote the message.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
<td>The message text.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>message</code></em>, in bytes.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>time</code></em> :</span></p></td>
<td>The time at which the user has written the message.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_chat_buffer_add_emote_message ()">
<a name="inf-chat-buffer-add-emote-message"></a><h3>inf_chat_buffer_add_emote_message ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_chat_buffer_add_emote_message   (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> *by</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *message</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
                                                         <em class="parameter"><code><span class="type">time_t</span> time</code></em>);</pre>
<p>
Adds a new emote message to the chat buffer. If the buffer is full
(meaning the number of messages in the buffer equals its size), then an
old message will get discarded. If the message to be added is older than
all other messages in the buffer, then it will not be added at all.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>A <a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>by</code></em> :</span></p></td>
<td>A <a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> who wrote the message.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
<td>The message text.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>message</code></em>, in bytes.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>time</code></em> :</span></p></td>
<td>The time at which the user has written the message.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_chat_buffer_add_userjoin_message ()">
<a name="inf-chat-buffer-add-userjoin-message"></a><h3>inf_chat_buffer_add_userjoin_message ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_chat_buffer_add_userjoin_message
                                                        (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> *user</code></em>,
                                                         <em class="parameter"><code><span class="type">time_t</span> time</code></em>);</pre>
<p>
Adds a new userjoin message to the chat buffer. If the buffer is full
(meaning the number of messages in the buffer equals its size), then an
old message will get discarded. If the message to be added is older than
all other messages in the buffer, then it will not be added at all.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>A <a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>A <a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> who wrote the message.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>time</code></em> :</span></p></td>
<td>The time at which the user has written the message.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_chat_buffer_add_userpart_message ()">
<a name="inf-chat-buffer-add-userpart-message"></a><h3>inf_chat_buffer_add_userpart_message ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_chat_buffer_add_userpart_message
                                                        (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> *user</code></em>,
                                                         <em class="parameter"><code><span class="type">time_t</span> time</code></em>);</pre>
<p>
Adds a new userpart message to the chat buffer. If the buffer is full
(meaning the number of messages in the buffer equals its size), then an
old message will get discarded. If the message to be added is older than
all other messages in the buffer, then it will not be added at all.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>A <a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td>A <a class="link" href="InfUser.html" title="InfUser"><span class="type">InfUser</span></a> who wrote the message.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>time</code></em> :</span></p></td>
<td>The time at which the user has written the message.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_chat_buffer_get_message ()">
<a name="inf-chat-buffer-get-message"></a><h3>inf_chat_buffer_get_message ()</h3>
<pre class="programlisting">const <a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="returnvalue">InfChatBufferMessage</span></a> * inf_chat_buffer_get_message
                                                        (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> n</code></em>);</pre>
<p>
Returns the message with the given index from the buffer. The oldest
message in the buffer has index 0, and the most recent one has index
<a class="link" href="InfChatBuffer.html#inf-chat-buffer-get-n-messages" title="inf_chat_buffer_get_n_messages ()"><code class="function">inf_chat_buffer_get_n_messages()</code></a> - 1.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>A <a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
<td>The index of the message to obtain.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The <a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="type">InfChatBufferMessage</span></a> with the given index.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_chat_buffer_get_n_messages ()">
<a name="inf-chat-buffer-get-n-messages"></a><h3>inf_chat_buffer_get_n_messages ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               inf_chat_buffer_get_n_messages      (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>);</pre>
<p>
Returns the number of messages in the buffer.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>A <a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The number of messages in the buffer.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_chat_buffer_get_size ()">
<a name="inf-chat-buffer-get-size"></a><h3>inf_chat_buffer_get_size ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               inf_chat_buffer_get_size            (<em class="parameter"><code><a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> *buffer</code></em>);</pre>
<p>
Returns the size of the chat buffer, which is the maximum number of
messages that can be stored in the buffer.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>A <a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The number of messages in the chat buffer.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="InfChatBuffer.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "size" property'>
<a name="InfChatBuffer--size"></a><h3>The <code class="literal">"size"</code> property</h3>
<pre class="programlisting">  "size"                     <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a>                 : Read / Write / Construct Only</pre>
<p>The maxmimum number of messages saved.</p>
<p>Default value: 256</p>
</div>
</div>
<div class="refsect1" title="Signal Details">
<a name="InfChatBuffer.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2" title='The "add-message" signal'>
<a name="InfChatBuffer-add-message"></a><h3>The <code class="literal">"add-message"</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                user_function                      (<a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a>        *buffer,
                                                        <a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="type">InfChatBufferMessage</span></a> *message,
                                                        <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>              user_data)      : Run Last</pre>
<p>
This signal is emitted whenever a message has been added to <em class="parameter"><code>buffer</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>The <a class="link" href="InfChatBuffer.html" title="InfChatBuffer"><span class="type">InfChatBuffer</span></a> that is receiving a message.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
<td>The <a class="link" href="InfChatBuffer.html#InfChatBufferMessage" title="InfChatBufferMessage"><span class="type">InfChatBufferMessage</span></a> that was received.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>